<template>
	<view class="list">
		<view class="dis" v-for="(item,index) in list" :key="index">
			<view :class="['item', item.open_status ? '' : 'diabled']" >
				<view class="flex">
					<u-image width="168rpx" height="168rpx" :src="item.logo" border-radius="16rpx"></u-image>
					<view class="content">
						<view class="name">
							{{item.name}}
						</view>
						<view class="flex_1">
							<view class="address">
								{{item.address}}
							</view>
							<view class="distance">
								{{item.dis_str}}
							</view>
						</view>
						<view class="flex_2">
							<view class="tel">
								{{item.tel}}
							</view>
						</view>
					</view>
				</view>
			</view>
			<view class="flex3">
				<view class="newFlex" @click.stop="guideToShop(item)">
					<i class=" iconfont icon-a-map"></i>
					<view class="phoneText">
						导航到店
					</view>
				</view>
				<view class="newFlex"  @click.stop="phoneToShop(item.tel)">
					<i class=" iconfont1 iconfont icon-phone1"></i>
					<view class="phoneText">
						致电咨询
					</view>
				</view>
				<view class="newFlex" @click="goStore(item.id)">
					 <i class="iconfont icon-store"></i>
					<view class="phoneText">
						进入门店
					</view>
				</view>
			</view>
		</view>
	</view>
</template>

<script>
	export default {
		props: {
			list: {
				type: Array,
				default () {
					return [];
				},
			},
		},

		computed: {

		},

		methods: {
			// 导航
			guideToShop(item) {
				if (!item.latitude) return;
				uni.openLocation({
					latitude: parseFloat(item.latitude),
					longitude: parseFloat(item.longitude),
				});
			},
			// 电话
			phoneToShop(num) {
				this.$utils.makePhoneCall(num);
			},
			goStore(id) {
				uni.navigateTo({
					url: `/mch_store/mchCommodity/mchCommodity?mch_id=${id}`
				})
			}
		},
	};
</script>

<style lang="less" scoped>
	.iconfont{
		color: #000;
		font-size: 40rpx;
	}
	.iconfont1{
		color: #000;
		font-size: 32srpx;
	}
	.ml30{
		margin-left: 30rpx;
	}
	.newFlex{
		display: flex;
		align-items: center;
	}
	.flex3 {
		display: flex;
		align-items: center;
		justify-content: space-around;

		.phone {
			width: 56rpx;
			height: 56rpx;
			background: #FBECEB;
			border-radius: 120rpx;
			display: flex;
			align-items: center;
			justify-content: center;
		}

		.phoneText {
			font-weight: 600;
			font-size: 26rpx;
			color: #000;
			text-align: center;
			margin-left: 10rpx;
		}
	}
	.dis{
		padding: 24rpx;
		background: #fff;
		border-radius: 20rpx;
		margin: 24rpx 0rpx;
	}

	.list {
		padding: 0 24rpx 24rpx;

		.item {
			display: flex;
			margin-bottom: 24rpx;
			
		}


	}

	.flex {
		display: flex;
		align-items: center;
		width: 100%;

		.content {
			margin-left: 20rpx;
			width: 470rpx;
			flex-grow: 1;

			.name {
				font-weight: 600;
				font-size: 30rpx;
				color: #262626;
			}

			.flex_1 {
				display: flex;
				align-items: flex-start;
				justify-content: space-between;
				margin-top: 10rpx;

				.address {
					width: 360rpx;
					font-weight: 400;
					font-size: 24rpx;
					color: #8C8C8C;
				}

				.distance {
					font-weight: 400;
					font-size: 24rpx;
					color: #8C8C8C;
				}
			}

			.flex_2 {
				display: flex;
				align-items: center;
				justify-content: space-between;
				text-align: center;

				.tel {
					font-weight: 400;
					font-size: 24rpx;
					color: #8C8C8C;
				}

				.goStore {
					width: 112rpx;
					height: 54rpx;
					background: #F2F2F2;
					border-radius: 120rpx;
					font-weight: 600;
					font-size: 24rpx;
					color: #F0250E;
					line-height: 54rpx;
					margin-top: 10rpx;
				}
			}

		}

	}
</style>